package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class HelloServiceImpl   implements HelloService {
    @Override
    public String sayHello(String name) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello:"+name;
    }

    @Override
    public String  methodA(String name){
        try {
            Double sleepTime=Math.random()*100;
            Thread.sleep(sleepTime.intValue());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("...methodA...");
        return "methodA retuen:"+name;
    }

    @Override
    public String  methodB(String name){
        try {
            Double sleepTime=Math.random()*100;
            Thread.sleep(sleepTime.intValue());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("[methodB]");
        return "methodB retuen:"+name;
    }

    @Override
    public String  methodC(String name){
        try {
            Double sleepTime=Math.random()*100;
            Thread.sleep(sleepTime.intValue());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("===methodc===");
        return "methodC retuen:"+name;
    }

}
